-
Notifications
You must be signed in to change notification settings - Fork 579
feat(avm): gas mutations #19348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: merge-train/avm
Are you sure you want to change the base?
feat(avm): gas mutations #19348
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
7b56b51 to
93eb5a8
Compare
e8578e9 to
ae09b1d
Compare
93eb5a8 to
aa96990
Compare
3c26110 to
d291430
Compare
aa96990 to
3700f20
Compare
d291430 to
c282ab6
Compare
3d86939 to
d39d11f
Compare
c282ab6 to
40f1713
Compare
40f1713 to
fd2d950
Compare
4168739 to
6f984cd
Compare
fd2d950 to
5420487
Compare
6f984cd to
fbabbed
Compare
5420487 to
7e7dc6e
Compare
fbabbed to
ac33049
Compare
7e7dc6e to
445b83c
Compare
| // | ||
| // Gas bounds for mutation | ||
| constexpr uint32_t MIN_GAS = 0; | ||
| constexpr uint32_t AVM_MAX_PROCESSABLE_DA_GAS = (MAX_NOTE_HASHES_PER_TX * AVM_EMITNOTEHASH_BASE_DA_GAS) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not be 100% right, but probably ballpark? @sirasistant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah should be close enough
| case TxMutationOptions::GasUsedByPrivate: | ||
| // Mutate gas_used_by_private | ||
| fuzz_info("Mutating gas used by private"); | ||
| mutate_gas(tx.gas_used_by_private, rng); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do i need to check that this value is < gas_limits ? Or is it worthwhile trying out scenarios where this is not true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an improvement, we might want to generate taking into account the limit instead of generate + clamp, or we we'll overrepresent gas used by private == limit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or we could just generate it and then do modulo the limit
445b83c to
2308b5b
Compare
ac33049 to
193d8a7
Compare
193d8a7 to
3faa9e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! just a note on clamping vs the limit

Mutations for gas-related fields in the tx (including gasUsedByPrivate, and Feepayer)